package com.example.demo.repository;

import java.util.List;

import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import com.example.demo.custom.BaseRepository;
import com.example.demo.entity.SysDept;

@Repository
public interface SysDeptRepository extends BaseRepository<SysDept, Integer>{

	public List<SysDept> findByParentIsNullOrderByIdx1();
	
	@Query(value = "from SysDept t where t.parent.id=?1")
	public List<SysDept> findByParentId(Integer id);
}
